package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckItemMapper extends BaseMapper<CheckItem> {


    @Select("select * from t_checkitem limit #{begin},#{pageSize}")
    List<CheckItem> findPage(@Param("begin") int begin, @Param("pageSize") Integer pageSize);

    @Select("select * from t_checkitem  where code like #{code} limit #{begin},#{pageSize}")
    List<CheckItem> queryPageByCode(@Param("begin")int begin, @Param("pageSize")Integer pageSize, @Param("code") String code);

    @Select("select count(1) from t_checkitem where code like #{code}")
    long countCode(@Param("code") String code);

    @Select("select * from t_checkitem  where name like #{name} limit #{begin},#{pageSize}")
    List<CheckItem> queryPageByName(@Param("begin")int begin, @Param("pageSize")Integer pageSize,@Param("name") String name);

    @Select("select count(1) from t_checkitem where name like #{name}")
    long countName(@Param("name") String name);

    @Select("select * from t_checkitem")
    List<CheckItem> selectAll();
}
